package cn.sc.pai.test;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btnSecond1).setOnClickListener(myClick);
        findViewById(R.id.btnSecond2).setOnClickListener(myClick);
        findViewById(R.id.btnSecond3).setOnClickListener(myClick);
        findViewById(R.id.btnSecond4).setOnClickListener(myClick);
    }

    private View.OnClickListener myClick = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.btnSecond1:
                    startActivity(new Intent(MainActivity.this, Second1Activity.class));
                    break;
                case R.id.btnSecond2:
                    startActivity(new Intent(MainActivity.this, Second2Activity.class));
                    break;
                case R.id.btnSecond3:
                    startActivity(new Intent(MainActivity.this, Second3Activity.class));
                    break;
                case R.id.btnSecond4:
                    startActivity(new Intent(MainActivity.this, Second4Activity.class));
                    break;
            }
        }
    };
}
